<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>06_React渲染过程</title>
    <script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
    <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
</head>
<body>
    <div id="app"></div>
    <script type="text/babel">
        let app = document.getElementById("app")
        function times(){
            /* app.innerHTML=''
            
            let divE = document.createElement("div");
            let h1E = document.createElement("h1");
            let h2E = document.createElement("h2");

            h1E.innerHTML = "当前时间："
            h2E.innerHTML = new Date().toLocaleTimeString()

            divE.appendChild(h1E)
            divE.appendChild(h2E)

            app.appendChild(divE) */

            let ele = (
                <div>
                    <h1>当前时间：</h1>
                    <h2>{new Date().toLocaleTimeString()}</h2>    
                </div>
            )
            ReactDOM.render(ele,app);
        }
        setInterval(times,1000)

        

    </script>
</body>
</html>